<?php
/**
 * 暴击奖池奖品配置
 */
namespace App\Models\MainDB\Critical;

use App\Services\Tools\HelperService;
use Illuminate\Database\Eloquent\Model;

class CriticalPrize extends Model{

    protected $table = 'ln_critical_prize';     //数据库内完整表名

    protected $primaryKey = 'id';    //主键名

    public $timestamps = false;

    public function getModuleGiftIds($moduleId){
        $criticalGifts = $this->where([
            'module' => $moduleId,
            'status' =>1
        ])->get();
        $criticalGifts = empty($criticalGifts)?[]:$criticalGifts->toArray();
        $criticalGifts = HelperService::getArrayColumn($criticalGifts,'gift_id');
        return $criticalGifts;
    }
}